/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.playground.core.entity;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Tiago Peres
 */
public class Queue {
    private List<Room> rooms;
    // unique
    private final GameTitle gameTitle;
    
    public Queue(GameTitle gameTitle){
        this.gameTitle = gameTitle;
        rooms = new ArrayList<Room>();
    }
    
    public void push(Room room) {
        rooms.add(room);
    }
    
    public Room pop() {
        return rooms.remove(0);
    }
    
    public void addAsFirst(Room room){
        rooms.add(0, room);
    }

    // getters and setters
    public GameTitle getGameTitle() {
        return gameTitle;
    }
    
    public List<Room> getRooms(){
        return rooms;
    }
}
